package com.cai.xiaobai.config.jwt;


import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
@Component
public class InterceptorsConfig implements WebMvcConfigurer {

    @Resource
    TokenHandler tokenHandler;
    //拦截登录验证码
    @Override
    public void addInterceptors(InterceptorRegistry registry){
        registry.addInterceptor(tokenHandler).addPathPatterns("/**")
//            .excludePathPatterns("/user-info/login");    //对应的不拦截的请求
            .excludePathPatterns("/**");
    }
}
